package com.tripspins.app.helper;

import android.app.ActionBar;
import android.app.Activity;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.widget.ListView;

import com.tripspins.app.R;
import com.tripspins.app.adapter.DrawerMenuAdapter;

/**
 * Created by João.Rutkoski on 01/10/13.
 */
public class MenuHelper {

    public static void loadMenu(Activity a, boolean isOnTheRoad, boolean isAuthenticated)
    {
        /*final Activity activity = a;
        ActionBarDrawerToggle drawerToggle;
        DrawerLayout drawerLayout = (DrawerLayout)activity.findViewById(R.id.drawer_layout);
        ListView drawerList = (ListView)activity.findViewById(R.id.left_drawer);

        String[] drawerMenuOptions = new String[2];
        drawerMenuOptions[0] = isOnTheRoad ?
                activity.getResources().getString(R.string.drawer_current_trip)
                : activity.getResources().getString(R.string.drawer_start_new_trip);
        drawerMenuOptions[1] = activity.getResources().getString(R.string.drawer_my_trips);

        drawerMenuOptions[2] = activity.getResources().getString(R.string.session);

        drawerMenuOptions[3] = activity.getResources().getString(R.string.sync);


        DrawerMenuAdapter adapter = new DrawerMenuAdapter(activity, drawerMenuOptions,isOnTheRoad, isAuthenticated);

        drawerList.setAdapter(adapter);

        drawerToggle = new ActionBarDrawerToggle(
                activity,                  //host Activity
                drawerLayout,         //DrawerLayout object
                R.drawable.ic_launcher,  // nav drawer icon to replace 'Up' caret
                R.string.drawer_open,  // "open drawer" description
                R.string.drawer_close  // "close drawer" description ){

        };

        drawerLayout.setDrawerListener(drawerToggle);*/
        a.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
        //a.getActionBar().setHomeButtonEnabled(true);
        a.getActionBar().setDisplayShowHomeEnabled(true);
        //a.getActionBar().setDisplayHomeAsUpEnabled(true);
        ///*a.getActionBar().setDisplayShowTitleEnabled(false);





    }
}
